package timu;
import java.util.Scanner;
public class gongyueshu_gongbeishu {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入第一个正整数：");
        int a=sc.nextInt();
        System.out.println("请输入第二个正整数：");
        int b=sc.nextInt();
        int max=a>b?a:b;
        int min=a < b ? a : b;
        while (min != 0) {
            int temp = min;
            min = max % min;
            max = temp;
        }
        int gcd = max;
        System.out.println("最大公约数为：" + gcd);
        max=a>b?a:b;
        min=a < b ? a : b;
        int lcm = max*min/ gcd;
        System.out.println("最小公倍数为：" + lcm);
        sc.close();
    }
}
